/*
 * InstructionDescription.java
 * 
 * last update: 16.01.2010 by Stefan Saru
 * 
 * author:	Alec(panovici@elcom.pub.ro)
 * 
 * Obs:
 */


package engine;
import java.io.Serializable;
/**
 * The description of an instruction (i.e. the instruction in terms of
 * uninstantiated stuff (symbol names, module description, etc.))
 */

@SuppressWarnings("serial")
public abstract class InstructionDescription implements Serializable {
	/**
	 * the next instruction
	 */
	public InstructionDescription next = null;
	int delayBefore = 0;

	/**
	 * the NameSpace that contains this instruction
	 */
	NameSpaceDescription nsd;

	/**
	 * the line at wich this instruction is located
	 */
	int line;

	InstructionDescription(int delayBefore, int line, NameSpaceDescription nsd){
		this.delayBefore = delayBefore;
		this.line = line;
		this.nsd = nsd;
	}

	/**
	 * adds 'next' to this execution queue
	 */
	void add(InstructionDescription next){
		this.next = next;
	}

	abstract DefaultInstruction instantiate(NameSpace ns)throws ParseException;

	public String toString(){
		return nsd.toString(line) + ":";
	}
}

